package com.svpino.netflix;

import com.svpino.netflix.model.Catalog;
import com.svpino.netflix.model.CatalogItem;


public class Main {

	public static void main(String[] args) {
		
		try {
			Netflix netflix = new Netflix("5469h738h67uf6yfwkwk9g9u", "9GDHMEecp7");
			Catalog catalog = netflix.getCatalogContext()
				.expand(Branch.TITLE)
				//.expand(Branch.CAST)
				.take(10)
				.search("Number%208");
			
			for (CatalogItem catalogItem : catalog.getCatalogItems()) {
				System.out.println(catalogItem.getTitle() + " [" + catalogItem.getReleaseYear() + "] [" + catalogItem.getRating() + "] [" + catalogItem.getMaturityLevel() + "]");
				System.out.println(catalogItem.getSynopsis());
			}
			
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		
		/*Connection connection = new Connection("5469h738h67uf6yfwkwk9g9u", "9GDHMEecp7");
		List<Title> list = connection
			.getTitles()
			.term("step")
			.expand(Branch.TITLE)
		//	.expand(Branch.BOX_ART)
			.take(10)
			.list();*/
		
		/*for (CatalogTitle catalogTitle : list) {
			System.out.println(catalogTitle.getTitle());
			System.out.println(catalogTitle.getSynopsis());
			System.out.print(catalogTitle.getReleaseYear() + " - ");
			System.out.print(catalogTitle.getRating() + " - ");
			System.out.println(catalogTitle.getMpaaRating());
			
			for(Format format : catalogTitle.getFormats()) {
				System.out.print("\tFormat: " + format.getFormat() + ". ");
				if (format.getAvailableFrom() != null) {
					System.out.print("(" + format.getAvailableFrom().toString() + ") ");
				}
				if (format.getAvailableUntil() != null) {
					System.out.print("(" + format.getAvailableUntil().toString() + ") ");
				}
				
				if (format.getScreenFormat() != null) {
					System.out.print("[" + format.getScreenFormat() + "] ");
				}

				if (format.getLanguages() != null) {
					System.out.println();

					for (Language language : format.getLanguages()) {
						System.out.println("\t\t" + language.getLanguage() + " - " + language.getAudio());
					}
				}
			}
			
			for (String genre : catalogTitle.getGenres()) {
				System.out.println("\t\tGENRE: " + genre);
			}
		}
		*/
		/*List<Feature> fList = connection.getTitleFormats().list();
		for (Feature feature : fList) {
			System.out.println(feature.getTerm());
			
		}*/
		
	}
	
}

/*
  
<link 
	href="http://api.netflix.com/catalog/titles/series/70157334/format_availability" 
	rel="http://schemas.netflix.com/catalog/titles/format_availability" 
	title="formats">
	<delivery_formats>
		<availability available_from="1285916400" available_until="1380610800">
			<category scheme="http://api.netflix.com/categories/title_formats" label="instant" term="instant"></category>
		</availability>
		<availability available_from="1087257600">
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD"></category>
		</availability>
	</delivery_formats>
</link>

<link 
	href="http://api.netflix.com/catalog/titles/series/70157334/screen_formats" 
	rel="http://schemas.netflix.com/catalog/titles/screen_formats" 
	title="screen formats">
	<screen_formats>
		<screen_format>
			<category scheme="http://api.netflix.com/categories/screen_formats" label="Widescreen Anamorphic 1.78:1" term="Widescreen Anamorphic 1.78:1"></category>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD"></category>
		</screen_format>
	</screen_formats>
</link>

<link 
	href="http://api.netflix.com/catalog/titles/series/70157334/languages_and_audio" 
	rel="http://schemas.netflix.com/catalog/titles/languages_and_audio" 
	title="languages and audio">
	<languages_and_audio>
		<language_audio_format>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD">
				<category scheme="http://api.netflix.com/categories/languages" label="Spanish" term="Spanish">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 2.0 Stereo" term=" Dolby Digital 2.0 Stereo"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="French" term="French">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 2.0 Stereo" term=" Dolby Digital 2.0 Stereo"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="English" term="English">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 2.0 Stereo" term=" Dolby Digital 2.0 Stereo"></category>
				</category>
			</category>
		</language_audio_format>
	</languages_and_audio>
</link>


**
**
**
**
**
**
 
 
<link 
	href="http://api.netflix.com/catalog/titles/series/60037854/seasons/70018815/screen_formats" 
	rel="http://schemas.netflix.com/catalog/titles/screen_formats" 
	title="screen formats">
	<screen_formats>
		<screen_format>
			<category scheme="http://api.netflix.com/categories/screen_formats" label="Widescreen Anamorphic 1.78:1" term="Widescreen Anamorphic 1.78:1"></category>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD"></category>
		</screen_format>
	</screen_formats>
</link>



<link 
	href="http://api.netflix.com/catalog/titles/movies/60029681/screen_formats" 
	rel="http://schemas.netflix.com/catalog/titles/screen_formats" 
	title="screen formats">
	<screen_formats>
		<screen_format>
			<category scheme="http://api.netflix.com/categories/screen_formats" label="Full Screen 1.33:1" term="Full Screen 1.33:1"></category>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD"></category>
		</screen_format>
	</screen_formats>
</link>


<link 
	href="http://api.netflix.com/catalog/titles/movies/70165485/screen_formats" 
	rel="http://schemas.netflix.com/catalog/titles/screen_formats" 
	title="screen formats">
	<screen_formats>
		<screen_format>
			<category scheme="http://api.netflix.com/categories/screen_formats" label="Widescreen Anamorphic 2.35:1" term="Widescreen Anamorphic 2.35:1"></category>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD"></category>
		</screen_format>
		<screen_format>
			<category scheme="http://api.netflix.com/categories/screen_formats" label="Widescreen 2.35:1" term="Widescreen 2.35:1"></category>
			<category scheme="http://api.netflix.com/categories/title_formats" label="Blu-ray" term="Blu-ray"></category>
		</screen_format>
	</screen_formats>
</link>

<link href="http://api.netflix.com/catalog/titles/series/70089226/languages_and_audio" rel="http://schemas.netflix.com/catalog/titles/languages_and_audio" title="languages and audio">
	<languages_and_audio>
		<language_audio_format>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD">
				<category scheme="http://api.netflix.com/categories/languages" label="Spanish" term="Spanish">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 2.0 Stereo" term=" Dolby Digital 2.0 Stereo"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="French" term="French">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 5.1" term=" Dolby Digital 5.1"></category>
					</category>
				<category scheme="http://api.netflix.com/categories/languages" label="English" term="English">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 5.1" term=" Dolby Digital 5.1"></category>
				</category>
			</category>
		</language_audio_format>
		<language_audio_format>
			<category scheme="http://api.netflix.com/categories/title_formats" label="Blu-ray" term="Blu-ray">
				<category scheme="http://api.netflix.com/categories/languages" label="Spanish" term="Spanish">
					<category scheme="http://api.netflix.com/categories/audio" label=" DTS 2.0 HD" term=" DTS 2.0 HD"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="French" term="French">
					<category scheme="http://api.netflix.com/categories/audio" label=" DTS 5.1 Surround" term=" DTS 5.1 Surround"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="English" term="English">
					<category scheme="http://api.netflix.com/categories/audio" label=" DTS 5.1 HD" term=" DTS 5.1 HD"></category>
				</category>
			</category>
		</language_audio_format>
	</languages_and_audio>
</link>

<link 
	href="http://api.netflix.com/catalog/titles/movies/70125552/languages_and_audio" 
	rel="http://schemas.netflix.com/catalog/titles/languages_and_audio" 
	title="languages and audio">
	<languages_and_audio>
		<language_audio_format>
			<category scheme="http://api.netflix.com/categories/title_formats" label="DVD" term="DVD">
				<category scheme="http://api.netflix.com/categories/languages" label="English" term="English">
					<category scheme="http://api.netflix.com/categories/audio" label=" Dolby Digital 5.1" term=" Dolby Digital 5.1"></category>
				</category>
			</category>
		</language_audio_format>
		<language_audio_format>
			<category scheme="http://api.netflix.com/categories/title_formats" label="Blu-ray" term="Blu-ray">
				<category scheme="http://api.netflix.com/categories/languages" label="French-Canadian" term="French-Canadian">
					<category scheme="http://api.netflix.com/categories/audio" label=" DTS 5.1 Surround" term=" DTS 5.1 Surround"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="Spanish" term="Spanish">
					<category scheme="http://api.netflix.com/categories/audio" label=" DTS 5.1 Surround" term=" DTS 5.1 Surround"></category>
				</category>
				<category scheme="http://api.netflix.com/categories/languages" label="English" term="English">
					<category scheme="http://api.netflix.com/categories/audio" label=" DTS 5.1 HD" term=" DTS 5.1 HD"></category>
				</category>
			</category>
		</language_audio_format>
	</languages_and_audio>
</link>

<link 
	href="http://api.netflix.com/catalog/titles/movies/70125552/cast" 
	rel="http://schemas.netflix.com/catalog/people.cast" 
	title="cast">
	<people>
		<link href="http://api.netflix.com/catalog/people/20000982" rel="http://schemas.netflix.com/catalog/person" title="Ben Stiller"></link>
		<link href="http://api.netflix.com/catalog/people/22588" rel="http://schemas.netflix.com/catalog/person" title="Robert De Niro"></link>
		<link href="http://api.netflix.com/catalog/people/20028089" rel="http://schemas.netflix.com/catalog/person" title="Jessica Alba"></link>
		<link href="http://api.netflix.com/catalog/people/165389" rel="http://schemas.netflix.com/catalog/person" title="Owen Wilson"></link>
		<link href="http://api.netflix.com/catalog/people/42366" rel="http://schemas.netflix.com/catalog/person" title="Dustin Hoffman"></link>
		<link href="http://api.netflix.com/catalog/people/74325" rel="http://schemas.netflix.com/catalog/person" title="Teri Polo"></link>
		<link href="http://api.netflix.com/catalog/people/48580" rel="http://schemas.netflix.com/catalog/person" title="Harvey Keitel"></link>
		<link href="http://api.netflix.com/catalog/people/88704" rel="http://schemas.netflix.com/catalog/person" title="Barbra Streisand"></link>
		<link href="http://api.netflix.com/catalog/people/21795" rel="http://schemas.netflix.com/catalog/person" title="Blythe Danner"></link>
		<link href="http://api.netflix.com/catalog/people/23978" rel="http://schemas.netflix.com/catalog/person" title="Laura Dern"></link>
	</people>
</link>


 */ 
